package com.wang.thread;

/**
 * 线程实现，一般使用实现Runable
 */
public class ThreadWang extends Thread{

    @Override
    public void run() {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("当前运行线程是"+Thread.currentThread().getName());
    }

    public static void main(String[] args) {
        Thread thread = new Thread(new ThreadWang());
        System.out.println("主线程即将开启子线程：：");
        thread.start();
        System.out.println("主线程已经执行完");
    }
}
